package demo;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class MapTest {
    public static void main(String[] args) {
        Map<String, Double> map = new HashMap<>();
        map.put("Tom",2000.00);
        map.put("Jack",1000.00);
        map.put("Jerry",800.00);
        map.put("Jan",900.00);
        map.put("Tony",3000.00);

        map.remove("Tom");
        map.put("Jack",1500.00);

        Set<Map.Entry<String, Double>> entries = map.entrySet();
        for (Map.Entry<String,Double> e: entries) {
//            System.out.println(e.getKey() + "-" + e.getValue());

            if (e.getValue() < 1000.00) {
            double d = e.getValue() + e.getValue() * 0.2;
                System.out.println(e.getKey() + "-" + d);
            }else {
                System.out.println(e.getKey() + "-" + e.getValue());
            }

        }

    }
}
